\(\int \frac {-2+x}{\sqrt {-3+x} (-8+x^2)} \, dx\) [1471]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 45 \[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\frac {\arctan \left (\left (-1+\sqrt {2}\right ) \sqrt {-3+x}\right )}{\sqrt {2}}+\frac {\arctan \left (\left (1+\sqrt {2}\right ) \sqrt {-3+x}\right )}{\sqrt {2}} \]

[Out]

1/2*arctan((2^(1/2)-1)*(-3+x)^(1/2))*2^(1/2)+1/2*arctan((1+2^(1/2))*(-3+x)^(1/2))*2^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.27, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {841, 1177, 209} \[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\frac {\arctan \left (\frac {\sqrt {x-3}}{\sqrt {3-2 \sqrt {2}}}\right )}{\sqrt {2}}+\frac {\arctan \left (\frac {\sqrt {x-3}}{\sqrt {3+2 \sqrt {2}}}\right )}{\sqrt {2}} \]

[In]

Int[(-2 + x)/(Sqrt[-3 + x]*(-8 + x^2)),x]

[Out]

ArcTan[Sqrt[-3 + x]/Sqrt[3 - 2*Sqrt[2]]]/Sqrt[2] + ArcTan[Sqrt[-3 + x]/Sqrt[3 + 2*Sqrt[2]]]/Sqrt[2]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 841

Int[((f_.) + (g_.)*(x_))/(Sqrt[(d_.) + (e_.)*(x_)]*((a_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[2, Subst[Int[(e*f
 - d*g + g*x^2)/(c*d^2 + a*e^2 - 2*c*d*x^2 + c*x^4), x], x, Sqrt[d + e*x]], x] /; FreeQ[{a, c, d, e, f, g}, x]
 && NeQ[c*d^2 + a*e^2, 0]

Rule 1177

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - a*e^2, 0] && GtQ[b^2
 - 4*a*c, 0]

Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int \frac {1+x^2}{1+6 x^2+x^4} \, dx,x,\sqrt {-3+x}\right ) \\ & = \frac {1}{2} \left (2-\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{3-2 \sqrt {2}+x^2} \, dx,x,\sqrt {-3+x}\right )+\frac {1}{2} \left (2+\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{3+2 \sqrt {2}+x^2} \, dx,x,\sqrt {-3+x}\right ) \\ & = \frac {\tan ^{-1}\left (\frac {\sqrt {-3+x}}{\sqrt {3-2 \sqrt {2}}}\right )}{\sqrt {2}}+\frac {\tan ^{-1}\left (\frac {\sqrt {-3+x}}{\sqrt {3+2 \sqrt {2}}}\right )}{\sqrt {2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.58 \[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\frac {\arctan \left (\frac {-4+x}{2 \sqrt {2} \sqrt {-3+x}}\right )}{\sqrt {2}} \]

[In]

Integrate[(-2 + x)/(Sqrt[-3 + x]*(-8 + x^2)),x]

[Out]

ArcTan[(-4 + x)/(2*Sqrt[2]*Sqrt[-3 + x])]/Sqrt[2]

Maple [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.37 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.38

method result size
trager \(-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right ) \ln \left (-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right ) x^{2}+8 \sqrt {-3+x}\, x -16 \operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right ) x -32 \sqrt {-3+x}+40 \operatorname {RootOf}\left (\textit {\_Z}^{2}+2\right )}{x^{2}-8}\right )}{4}\) \(62\)
derivativedivides \(\frac {\left (1+\sqrt {2}\right ) \sqrt {2}\, \arctan \left (\frac {2 \sqrt {-3+x}}{2+2 \sqrt {2}}\right )}{2+2 \sqrt {2}}+\frac {\left (\sqrt {2}-1\right ) \sqrt {2}\, \arctan \left (\frac {2 \sqrt {-3+x}}{-2+2 \sqrt {2}}\right )}{-2+2 \sqrt {2}}\) \(72\)
default \(\frac {\left (1+\sqrt {2}\right ) \sqrt {2}\, \arctan \left (\frac {2 \sqrt {-3+x}}{2+2 \sqrt {2}}\right )}{2+2 \sqrt {2}}+\frac {\left (\sqrt {2}-1\right ) \sqrt {2}\, \arctan \left (\frac {2 \sqrt {-3+x}}{-2+2 \sqrt {2}}\right )}{-2+2 \sqrt {2}}\) \(72\)

[In]

int((-2+x)/(x^2-8)/(-3+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/4*RootOf(_Z^2+2)*ln(-(RootOf(_Z^2+2)*x^2+8*(-3+x)^(1/2)*x-16*RootOf(_Z^2+2)*x-32*(-3+x)^(1/2)+40*RootOf(_Z^
2+2))/(x^2-8))

Fricas [A] (verification not implemented)

none

Time = 0.41 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.42 \[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\frac {1}{2} \, \sqrt {2} \arctan \left (\frac {\sqrt {2} {\left (x - 4\right )}}{4 \, \sqrt {x - 3}}\right ) \]

[In]

integrate((-2+x)/(x^2-8)/(-3+x)^(1/2),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*arctan(1/4*sqrt(2)*(x - 4)/sqrt(x - 3))

Sympy [F]

\[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\int \frac {x - 2}{\sqrt {x - 3} \left (x^{2} - 8\right )}\, dx \]

[In]

integrate((-2+x)/(x**2-8)/(-3+x)**(1/2),x)

[Out]

Integral((x - 2)/(sqrt(x - 3)*(x**2 - 8)), x)

Maxima [F]

\[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\int { \frac {x - 2}{{\left (x^{2} - 8\right )} \sqrt {x - 3}} \,d x } \]

[In]

integrate((-2+x)/(x^2-8)/(-3+x)^(1/2),x, algorithm="maxima")

[Out]

integrate((x - 2)/((x^2 - 8)*sqrt(x - 3)), x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.51 \[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\frac {1}{4} \, \sqrt {2} {\left (\pi + 2 \, \arctan \left (\frac {\sqrt {2} {\left (x - 4\right )}}{4 \, \sqrt {x - 3}}\right )\right )} \]

[In]

integrate((-2+x)/(x^2-8)/(-3+x)^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(2)*(pi + 2*arctan(1/4*sqrt(2)*(x - 4)/sqrt(x - 3)))

Mupad [B] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.87 \[ \int \frac {-2+x}{\sqrt {-3+x} \left (-8+x^2\right )} \, dx=\frac {\sqrt {2}\,\left (\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {x-3}}{4}\right )+\mathrm {atan}\left (\frac {7\,\sqrt {2}\,\sqrt {x-3}}{4}+\frac {\sqrt {2}\,{\left (x-3\right )}^{3/2}}{4}\right )\right )}{2} \]

[In]

int((x - 2)/((x^2 - 8)*(x - 3)^(1/2)),x)

[Out]

(2^(1/2)*(atan((2^(1/2)*(x - 3)^(1/2))/4) + atan((7*2^(1/2)*(x - 3)^(1/2))/4 + (2^(1/2)*(x - 3)^(3/2))/4)))/2